package com.itheima.thread.api.demo08;

public class ThreadDemo02 {

    public static void main(String[] args) {

        MyThread t1 = new MyThread();
        MyThread t2 = new MyThread();

        t1.setName("张飞");
        t2.setName("关羽");

        t1.setDaemon(true);
        t2.setDaemon(true);

        t1.start();
        t2.start();

        Thread.currentThread().setName("刘备");
        for(int x = 0; x < 10; x++) {
            System.out.println(Thread.currentThread().getName() + "----" + x);
        }

    }

}
